<?php

namespace app\index\validate\consulting;

use ShidianUtil\Thinkphp\Validate\BaseValidate;

/**
 * Class Consulting
 * @package app\consulting\validate
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037623
 */
class Consulting extends BaseValidate
{

    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'id'	=> 'isId',
		'memberId'	=> 'integer|egt:0|max:11',
		'lawyerId'	=> 'integer|egt:0|max:11',
		'consultingServerId'	=> 'integer|egt:0|max:11',
		'consultingType'	=> 'integer|egt:0|max:3',
		'matchType'	=> 'integer|egt:0|max:3',
		'status'	=> 'integer|max:3',
		'isAsked'	=> 'integer|egt:0|max:1',
		'ask'	=> 'scalar|max:2000',
		'questionId'	=> 'integer|egt:0|max:11',
		'questionsNum'	=> 'integer|egt:0|max:10',
		'isChatFreely'	=> 'integer|max:1',
		'isChatFreelyEndTime'	=> 'likeId',
		'freeNum'	=> 'integer|egt:0|max:3',
		'isComment'	=> 'integer|max:1',
		'commentLevel'	=> 'integer|max:11',
		'comment'	=> 'scalar|max:2000',
		'updated'	=> 'integer|egt:0|max:11',
		'created'	=> 'integer|egt:0|max:11',
        'page'      => 'integer|egt:0|max:11',
        'page_size' => 'integer|egt:0|max:11',
    ];

    protected $field = [
        'id'	=> 'id',
		'memberId'	=> 'memberId',
		'lawyerId'	=> 'lawyerId',
		'consultingServerId'	=> 'consultingServerId',
		'consultingType'	=> 'consultingType',
		'matchType'	=> 'matchType',
		'status'	=> 'status',
		'isAsked'	=> 'isAsked',
		'ask'	=> 'ask',
		'questionId'	=> 'questionId',
		'questionsNum'	=> 'questionsNum',
		'isChatFreely'	=> 'isChatFreely',
		'isChatFreelyEndTime'	=> 'isChatFreelyEndTime',
		'freeNum'	=> 'freeNum',
		'isComment'	=> 'isComment',
		'commentLevel'	=> 'commentLevel',
		'comment'	=> 'comment',
		'updated'	=> 'updated',
		'created'	=> 'created',
        'page'      => '分页页数',
        'page_size' => '分页大小',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [
        'id.require'	=> '缺少:attribute',
		'id.isId'	=> '请设置正确的:attribute',
		'memberId.require'	=> '请输入:attribute',
		'memberId.integer' => ':attribute应该是整数',
		'memberId.egt'	=> ':attribute应该大于等于:rule',
		'memberId.max'	=> ':attribute长度不能超过:rule位',
		'lawyerId.require'	=> '请输入:attribute',
		'lawyerId.integer' => ':attribute应该是整数',
		'lawyerId.egt'	=> ':attribute应该大于等于:rule',
		'lawyerId.max'	=> ':attribute长度不能超过:rule位',
		'consultingServerId.require'	=> '请输入:attribute',
		'consultingServerId.integer' => ':attribute应该是整数',
		'consultingServerId.egt'	=> ':attribute应该大于等于:rule',
		'consultingServerId.max'	=> ':attribute长度不能超过:rule位',
		'consultingType.require'	=> '请输入:attribute',
		'consultingType.integer' => ':attribute应该是整数',
		'consultingType.egt'	=> ':attribute应该大于等于:rule',
		'consultingType.max'	=> ':attribute长度不能超过:rule位',
		'matchType.require'	=> '请输入:attribute',
		'matchType.integer' => ':attribute应该是整数',
		'matchType.egt'	=> ':attribute应该大于等于:rule',
		'matchType.max'	=> ':attribute长度不能超过:rule位',
		'status.require'	=> '请输入:attribute',
		'status.integer' => ':attribute应该是整数',
		'status.max'	=> ':attribute长度不能超过:rule位',
		'isAsked.require'	=> '请输入:attribute',
		'isAsked.integer' => ':attribute应该是整数',
		'isAsked.egt'	=> ':attribute应该大于等于:rule',
		'isAsked.max'	=> ':attribute长度不能超过:rule位',
		'ask.require'	=> '请输入:attribute',
		'ask.scalar' => ':attribute应该是字符串',
		'ask.max'	=> ':attribute长度不能超过:rule位',
		'questionId.require'	=> '请输入:attribute',
		'questionId.integer' => ':attribute应该是整数',
		'questionId.egt'	=> ':attribute应该大于等于:rule',
		'questionId.max'	=> ':attribute长度不能超过:rule位',
		'questionsNum.require'	=> '请输入:attribute',
		'questionsNum.integer' => ':attribute应该是整数',
		'questionsNum.egt'	=> ':attribute应该大于等于:rule',
		'questionsNum.max'	=> ':attribute长度不能超过:rule位',
		'isChatFreely.require'	=> '请输入:attribute',
		'isChatFreely.integer' => ':attribute应该是整数',
		'isChatFreely.max'	=> ':attribute长度不能超过:rule位',
		'isChatFreelyEndTime.require'	=> '请选择:attribute',
		'isChatFreelyEndTime.isId'	=> '请选择正确的:attribute',
		'freeNum.require'	=> '请输入:attribute',
		'freeNum.integer' => ':attribute应该是整数',
		'freeNum.egt'	=> ':attribute应该大于等于:rule',
		'freeNum.max'	=> ':attribute长度不能超过:rule位',
		'isComment.require'	=> '请输入:attribute',
		'isComment.integer' => ':attribute应该是整数',
		'isComment.max'	=> ':attribute长度不能超过:rule位',
		'commentLevel.require'	=> '请输入:attribute',
		'commentLevel.integer' => ':attribute应该是整数',
		'commentLevel.max'	=> ':attribute长度不能超过:rule位',
		'comment.require'	=> '请输入:attribute',
		'comment.scalar' => ':attribute应该是字符串',
		'comment.max'	=> ':attribute长度不能超过:rule位',
		'updated.require'	=> '请输入:attribute',
		'updated.integer' => ':attribute应该是整数',
		'updated.egt'	=> ':attribute应该大于等于:rule',
		'updated.max'	=> ':attribute长度不能超过:rule位',
		'created.require'	=> '请输入:attribute',
		'created.integer' => ':attribute应该是整数',
		'created.egt'	=> ':attribute应该大于等于:rule',
		'created.max'	=> ':attribute长度不能超过:rule位',
        'page.require'      => '请输入:attribute',
        'page.integer'      => ':attribute应该是整数',
        'page.egt'          => ':attribute应该大于等于:rule',
        'page.max'          => ':attribute长度不能超过:rule位',
        'page_size.require' => '请输入:attribute',
        'page_size.integer' => ':attribute应该是整数',
        'page_size.egt'     => ':attribute应该大于等于:rule',
        'page_size.max'     => ':attribute长度不能超过:rule位',
    ];

    protected $scene = [
        'delete' => ['id' => 'require'],
        'index'  => ['page', 'page_size'],
        'read'   => ['id' => 'require'],
        'save'   => ['memberId', 'lawyerId', 'consultingServerId', 'consultingType', 'matchType', 'status', 'isAsked', 'ask', 'questionId', 'questionsNum', 'isChatFreely', 'isChatFreelyEndTime', 'freeNum', 'isComment', 'commentLevel', 'comment', 'updated', 'created'],
    ];

}
